<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>景区信息列表</title>
<%@include file="../header.jsp" %>
<script type="text/javascript" src="/js/area-select.js"></script>
<script type="text/javascript">
	function turnpage(page) {
		query(page);
	}
	
	function query(page) {
		var param = {
			name:$("#name").val(),
			dic_scenic_level:$("#DictionaryId").val(),
			sce_address:$("#fullAddress").val()
		}
		if(page!=null) {
			param.pageNo = page; 
		}
		$.ajax({
			url:"/scene/query.htm",
			type:"post",
			data:param,
			dataType:"html"
		}).done(function(data){
			$("#scene-table").html(data);
		})
	}
	
	function delScene() {
		var checks = $("#scene-table").find("input[type='checkbox']:checked");
		if(window.confirm("确定要删除？")) {
			$.ajax({
				url:"/scene/del_scene.htm",
				type:"post",
				data:$("#scene-tableform").serialize(),
				dataType:"json"
			}).done(function(data){
				alert(data.msg);
				if(data.isSuccess) 
					window.location = "/scene/list.htm";
			})
		}
	}
	
	function editScene(id) {
		/* var checks = $("#scene-table").find("input[type='checkbox']:checked");
		var size = checks.size();
		if(size==0)
			alert("请选择要修改的记录");
		else if(size>1) 
			alert("一次只能修改一条记录");
		else { */
			window.location = "/scene/edit_view.htm?id="+id;
		//}
	}
</script>
</head>
<body>
	<div class="ch-container">
		<div class="row">
			<div class="box col-md-12">
        <div class="box-inner">
            <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> 查询条件</h2>

                <div class="box-icon">
                    <a href="javascript:;" class="btn btn-setting btn-round btn-default"><i
                            class="glyphicon glyphicon-cog"></i></a>
                    <a href="javascript:;" class="btn btn-minimize btn-round btn-default"><i
                            class="glyphicon glyphicon-chevron-up"></i></a>
                    <a href="javascript:;" class="btn btn-close btn-round btn-default"><i
                            class="glyphicon glyphicon-remove"></i></a>
                </div>
            </div>
            <div class="box-content">
                <form class="form-inline">
                    <div class="form-group">
                        <label>景区名称：</label>
                        <input id="name" type="text" class="form-control">
                    </div>
                    <div class="clearfix"></div><br>
                    <div class="form-group">
                        <label>景区星级：</label>
                        <select id="DictionaryId" class="form-control">
                        	<option value="">--请选择--</option>
                        	<c:forEach items="${levels }" var="level">
                        		<option value="${level.dictionaryId }">${level.name }</option>
                        	</c:forEach>
                        </select>
                    </div>
                    <div class="clearfix"></div><br>
                    <div class="form-group">
                        <label>景区位置：</label>
                        <span>
                        <select class="area-select form-control">
                        	<option value="">--请选择--</option>
                        	<c:forEach items="${provinces }" var="province">
                        		<option value="${province.admDivId }">${province.name }</option>
                        	</c:forEach>
                        </select>
                        <select class="area-select form-control">
                        	<option value="">--请选择--</option>
                        </select>
                        <select class="area-select form-control">
                        	<option value="">--请选择--</option>
                        </select>
                        </span>
                        <input id="fullAddress" type="text" class="form-control">
                    </div>
                    <div class="clearfix"></div><br>
                    <a href="javascript:;" class="btn btn-default" onclick="query();">查询</a>
                </form>

            </div>
        </div>
    </div>
    <!--/span-->
		</div>
		<div class="row">
			<div class="box col-md-12">
			    <div class="box-inner">
			    <div class="box-header well" data-original-title="">
			        <h2><i class="glyphicon glyphicon-user"></i> 景区列表</h2>
			
			        <div class="box-icon">
			            <a href="#" class="btn btn-setting btn-round btn-default"><i class="glyphicon glyphicon-cog"></i></a>
			            <a href="#" class="btn btn-minimize btn-round btn-default"><i
			                    class="glyphicon glyphicon-chevron-up"></i></a>
			            <a href="#" class="btn btn-close btn-round btn-default"><i class="glyphicon glyphicon-remove"></i></a>
			        </div>
			    </div>
			    <div class="box-content" id="scene-table">
			    <jsp:include page="table.jsp"/>
			    </div>
			</div>
		</div>
		<!--/span-->
		</div>
	</div>

</body>
</html>